package com.sunjy.demo1.configuration;

import com.sunjy.common.aop.BeanValidAspect;
import com.sunjy.common.filter.CheckData;
import com.sunjy.common.filter.FilterAction;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.ArrayList;
import java.util.List;

@Configuration
public class FilterManager {

    @Value("${beanValid.flag}")
    private Boolean beanFlag;

    @Bean
    public BeanValidAspect  managerAspect(){
        BeanValidAspect beanValidAspect=new BeanValidAspect();
        beanValidAspect.setBeanFlag(beanFlag);
        List<FilterAction>list=new ArrayList();
        CheckData checkData =new CheckData();
        list.add(checkData);
        beanValidAspect.setActions(list);
        return beanValidAspect;

    }

}
